#include  <cstdio>

int v[7];
int total;

bool search(int i, int sum)
{
	if(i == sum)
		return true;
	if(i > sum)
		return false;
	int k = 6;
	while(v[k] == 0) --k;
	if(i < k && sum == total)
		return false;

	bool res;
	for( k = i; k > 0 ; --k )
	{
		if(v[k] == 0)
			continue;
		v[k]--;
		if(v[k] > 0)
			res = search(k,sum-k);
		else
		{
			int o = k - 1;
			while(v[o] == 0) --o;
			res = search(o,sum-k);
		}
		if(res)
			return true;
		else
			v[k]++;
	}

	return false;
}

int main(int argc, char *argv[])
{
	int counter = 0;
	while(true)
	{
		int sum = 0;
		for(int i = 1; i < 7; ++i)
		{
			scanf("%d",&v[i]);
			v[i] %= 60;
			sum += v[i]*i;
		}
		if(sum == 0)
			break;
		total = sum/2;

		int i = 6;
		while(v[i] == 0) --i;
		
		printf("Collection #%d:\n",++counter);
		if ( sum % 2 == 0 && search(i,sum/2))
			printf("Can be divided.\n\n");
		else
			printf("Can't be divided.\n\n");
	}
}
